<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" lang="en">
<head>
<title>Библиотека №1 | Выдача книг</title>

<meta http-equiv="content-type" content="text/html; charset=utf-8">
    <link th:href="@{/styles/style.css}" rel="stylesheet" type="text/css">

</head>
<body>
<div class="main">
  <div class="header">
    <div class="header_resize">
      <div class="logo">
        <h1><a href="/libAssistant/main"><span>Библиотека №1</span>
        <br><small>Тёплый дом у дороги</small></a></h1>
      </div>
      <div class="menu">
        <ul>
            <li><a href="/libAssistant/main">На главную</a></li>
            <li><a href="/libAssistant/about">О библиотеке</a></li>

        </ul>
      </div>
      <div class="clr"></div>
    </div>

  </div>
  <div class="body">
    <div class="body_resize">
      <div class="left">
        <div class="resize_bg">
          <h2> Читатель</h2>

<form action="#" th:action="@{/librarian/findUserForGetBook}" method="POST">
    <label for="search-input">Имя читателя</label>
    <input type="text" th:name="search" id="search-input">

<!--    <input type="submit" value="search" action="search"  />-->
<!--    <input type="submit" value="clear" action="clear"  />-->
    <button type="submit" name="action" value="search">Поиск</button>
    <button type="submit" name="action" value="clear">Очистить</button>
</form>

<br>Выбран читатель :
<p th:utext="${currentUser.firstName + ' ' + currentUser.lastName}">Читатель не выбран</p>
<br>

<h2>Список книг</h2>

<form action="#" th:action="@{/librarian/borrowBook}" method="POST">
<table style="border: black" th:border="5">
    <tbody><tr>
        <td>Автор</td>
        <td>Название</td>
        <td>Год издания</td>
        <td>Издательство</td>
        <td>Удалить</td>
        <td>Возврат</td>
    </tr>
    <tr th:each="book: ${borrowBookList}">
        <td th:text="${book.author}">
        </td><td th:text="${book.title}">
        </td><td th:text="${book.year}">
        </td><td th:text="${book.publisher}">
        </td><td>

<!--            <a th:data-confirm-delete="|Are you sure you want to delete this book?|"-->
<!--               th:onclick="if (!confirm(this.getAttribute('data-confirm-delete'))) return false"-->
               <a th:href="@{/librarian/deleteBookFromBorrowList(bookId=${book.id})}">Удалить</a>
        </td>
        <td>
            <a th:href="@{/librarian/returnBook(bookId=${book.id})} ">Вернуть</a>
        </td>

    </tr>
</tbody></table>
    <button type="submit" name="action" value="searchBook">Поиск</button>
    <button type="submit" name="action" value="borrow">Выдать книги</button>
</form>

        </div>
      </div>

      <div class="clr"></div>
    </div>
  </div>

  <div class="footer">
    <div class="footer_resize">
      <p class="lf">Evgenij Pankrushov </p>
      <!-- <p class="rf">000</p> -->
      <div class="clr"></div>
    </div>
    <div class="clr"></div>
  </div>
</div>



</body></html>
